package com.gbq.qimo.service.impl;

import com.gbq.qimo.mapper.TeacherMapper;
import com.gbq.qimo.mapper.impl.TeacherMapperImpl;
import com.gbq.qimo.pojo.Teacher;
import com.gbq.qimo.service.TeacherService;

import java.util.List;

/**
 * @ClassName TeacherServiceImpl
 * @Description TODO
 * @Author guobenqi
 * @Date 2021/5/29 15:56
 */
public class TeacherServiceImpl implements TeacherService {
    private TeacherMapper teacherMapper = new TeacherMapperImpl();

    @Override
    public Teacher findTeacher(Teacher teacher) {
        return teacherMapper.findOneTeacher(teacher.getUsername(),teacher.getPassword());
    }

    @Override
    public List<Teacher> findAllTeacher() {
        return teacherMapper.findAllteacher();
    }

    @Override
    public int addTeacher(Teacher teacher) {
        return teacherMapper.addOneTeacher(teacher);
    }

    @Override
    public Teacher findTeacherByUsername(Teacher teacher) {
        return teacherMapper.findOneTeacherByUsername(teacher.getUsername());
    }

    @Override
    public int register(Teacher teacher) {
        return teacherMapper.register(teacher.getUsername(),teacher.getPassword());
    }
}
